package com.hand.demo.infra.repository.impl;

import org.apache.commons.collections.CollectionUtils;
import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.springframework.stereotype.Component;
import com.hand.demo.domain.entity.HhrTaTraining;
import com.hand.demo.domain.repository.HhrTaTrainingRepository;
import com.hand.demo.infra.mapper.HhrTaTrainingMapper;

import javax.annotation.Resource;
import java.util.List;

/**
 * 培训经历表(HhrTaTraining)资源库
 *
 * @author
 * @since 2025-06-16 12:16:50
 */
@Component
public class HhrTaTrainingRepositoryImpl extends BaseRepositoryImpl<HhrTaTraining> implements HhrTaTrainingRepository {
    @Resource
    private HhrTaTrainingMapper hhrTaTrainingMapper;

    @Override
    public List<HhrTaTraining> selectList(HhrTaTraining hhrTaTraining) {
        return hhrTaTrainingMapper.selectList(hhrTaTraining);
    }

    @Override
    public HhrTaTraining selectByPrimary(Long id) {
        HhrTaTraining hhrTaTraining = new HhrTaTraining();
        hhrTaTraining.setId(id);
        List<HhrTaTraining> hhrTaTrainings = hhrTaTrainingMapper.selectList(hhrTaTraining);
        if (hhrTaTrainings.size() == 0) {
            return null;
        }
        return hhrTaTrainings.get(0);
    }

}

